@echo off
pushd "%~dp0"
rem -------------------------------------------------
rem 清空Scripts\Table目录下的所有的CS文件
rem copy*.CS到Unity客户端
rem -------------------------------------------------
set dest=..\Assets
if exist "%dest%" (
	del /Q                "%dest%\Scripts\Table\*.cs"
	copy /Y *.cs          "%dest%\Scripts\Table"
	call:clearMeta        "%dest%\Scripts\Table"
)

rem ===================================================================
rem 递归删除给定目录中所有孤立的*.meta文件
rem 参数: 路径
:clearMeta
echo clear meta: %~1
for /f "tokens=* delims=" %%i in ('dir /b /s "%~1\*.meta"') do (
	if not exist "%%~dpni" (
		echo %%i
		del /Q "%%i"
	)
)
GOTO:EOF
